package com.client.service.impl;

import com.client.pojo.Entries;
import com.client.pojo.EntryCollects;
import com.client.dao.EntryCollectsDao;
import com.client.service.EntryCollectsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 词条收藏记录表 服务实现类
 * </p>
 *
 * @author ckick
 * @since 2025-09-20 08:28:54
 */
@Service
public class EntryCollectsServiceImpl extends ServiceImpl<EntryCollectsDao, EntryCollects> implements EntryCollectsService {
    @Autowired
    private EntryCollectsDao entryCollectsDao;
    @Override
    public boolean searchIfCollected(Integer userId, Integer entryId) {
        return baseMapper.searchIfCollected(userId,entryId);
    }

    @Override
    public void addCollects(Integer userId, Integer entryId, Integer authorId) {
        baseMapper.addCollects(userId,entryId,authorId);
    }

    @Override
    public void cancelCollects(Integer userId, Integer entryId) {
        baseMapper.cancelCollects(userId,entryId);
    }

    @Override
    public List<Entries> getEntryById(Integer userId) {
        return entryCollectsDao.getEntryById(userId);
    }
}
